﻿{% extends "admin/base.html" %}
{% load i18n %}

{% block header %}
<script type="text/javascript" src="/senbzblog/static/tinymce/tiny_mce.js"></script>
<script type="text/javascript" src="/senbzblog/static/admin/js/utils.js"></script>
<script type="text/javascript" src="/senbzblog/static/admin/js/tinymceinit.js"></script>
{% endblock %}

{% block content %}
<div>
	<h2 class="title1">{% trans "Add article" %}</h2>
	{% if messages %}
	<ul class="messages">
		{% for message in messages %}
		<li{% if message.tags %} class="{{ message.tags }}"{% endif %}>{{ message }}</li>
		{% endfor %}
	</ul>
	{% endif %}
	<form action="{{ blog.get_admin_save_article_url }}" method="post" class="full-width">
		<div>
			{{ articleform.id }}
			{{ articleform.is_published }}
			{{ articleform.blog }}
		</div>
		<div id="poststuff" class="metabox-holder">
			<div class="inner-sidebar">
				<div>
					<div class="dashboard-window">
						<h3>{{ articleform.tags.label_tag }}</h3>
						{{ articleform.tags }}
						{% if articleform.tags.errors %}
						{{ articleform.tags.errors }}
						{% else %}
						<p class="help_text">{{ articleform.tags.help_text }}</p>
						{% endif %}
					</div>
					<div class="dashboard-window">
						<h3>{{ articleform.category.label_tag }}<span class="red">*</span></h3>
						{{ articleform.category }}
						{% if articleform.category.errors %}
						{{ articleform.category.errors }}
						{% else %}
						<p class="help_text">{{ articleform.category.help_text }}</p>
						{% endif %}
					</div>
					<div class="dashboard-window">
						<h3>{% trans "Publish" %}</h3>
						<div>
							<div id="minor-publishing-actions">
								<span>
									{{ articleform.allow_comment }} 
									{{ articleform.allow_comment.label_tag }} <br/>
								</span>
								<div>
									<input type="submit" class="button" tabindex="4" 
										value="{% trans 'Save' %}" id="save-post" name="save">
									{% if article.is_published %}
								  	<input type="submit" value="{% trans 'Cancel Publish' %}" tabindex="5" 
								  		id="publish" class="button-primary alignright" name="unpublish">
								  	{%else%}
								  	<input type="submit" value="{% trans 'Publish' %}" tabindex="5" 
								  		id="publish" class="button-primary alignright" name="publish">
								  	{%endif%}
								</div>
								<div class="clear"></div>
							</div>
						</div>
					</div>
				</div>
			</div>
			<div class="has-sidebar">
				<div id="post-body-content" style="margin-right: 305px;">
					<div class="form-field">
						{{ articleform.title }}
						{% if articleform.title.errors %}
						{{ articleform.title.errors }}
						{% endif %}
					</div>
					<div class="form-field">
						{{ articleform.contents }}
						{% if articleform.contents.errors %}
						{{ articleform.contents.errors }}
						{% endif %}
					</div>
					<div class="form-field">
						<div class="dashboard-window">
							<h3>{{ articleform.slug.label_tag }}<span class="red">*</span></h3>
							{{ articleform.slug }}
							{% if articleform.slug.errors %}
							{{ articleform.slug.errors }}
							{% else %}
							<p class="help_text">{{ articleform.slug.help_text }}</p>
							{% endif %}
						</div>
					</div>
					<div class="form-field">
						<div class="dashboard-window">
							<h3>{{ articleform.summary.label_tag }}</h3>
							{{ articleform.summary }}
							{% if articleform.summary.errors %}
							{{ articleform.summary.errors }}
							{% else %}
							<p class="help_text">{{ articleform.summary.help_text }}</p>
							{% endif %}
						</div>
					</div>
				</div>
			</div>
			<b><br class="clear"></br></b>
		</div>
	</form>
</div>
{%endblock%}
